<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2657：[Zjoi2012]旅游(journey)</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Zjoi2012]旅游(journey)</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Zjoi2012]旅游(journey)</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Zjoi2012]旅游(journey)                </h1>
                <p>时间限制：5s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%"><font size="3"><span lang="EN-US"><span style="mso-spacerun: yes"><font face="Calibri">&nbsp;&nbsp;&nbsp;&nbsp; </font></span></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">到了难得的暑假，为了庆祝小白在数学考试中取得的优异成绩，小蓝决定带小白出去旅游</span></font><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">~~<o:p></o:p></font></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; line-height: 150%"><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><span style="mso-spacerun: yes"><font face="Calibri">&nbsp;&nbsp;&nbsp; </font></span></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">经过一番抉择，两人决定将</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">T</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">国作为他们的目的地。</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">T</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">国的国土可以用一个凸</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">N</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">边形来表示，</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">N</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">个顶点表示</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">N</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">个入境</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">/</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">出境口。</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">T</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">国包含</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">N-2</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">个城市，每个城市都是顶点均为</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">N</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">边形顶点的三角形</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">(</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">换而言之，<u>城市组成了关于</u></span><u><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">T</font></span></u><u><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">国的一个三角剖分</span></u><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">)</font></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">。<u>两人的旅游路线可以看做是连接</u></span><u><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">N</font></span></u><u><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">个顶点中<b style="mso-bidi-font-weight: normal">不相邻</b>两点的线段</span></u><span style="font-size: 12pt; line-height: 150%; font-family: 宋体; mso-bidi-font-size: 11.0pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri">。</span><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><o:p></o:p></span></p>
<p><img height="163" alt="" width="251" src="../file/2657_0.jpg" /></p>
<div style="line-height: 150%"><span>&nbsp;&nbsp; </span><span style="font-size: 12pt; line-height: 150%">为了能够买到最好的纪念品，小白希望旅游路线上经过的城市尽量多。作为小蓝的好友，你能帮帮小蓝吗？</span></div></p><hr/><h3>输入格式</h3><p><div style="text-indent: 26.25pt; line-height: 150%"><span>&nbsp;</span><span style="font-size: 12pt; line-height: 150%">每个输入文件中仅包含一个测试数据。</span></div>
<div style="text-indent: 30pt; line-height: 150%"><span style="font-size: 12pt; line-height: 150%">第一行包含两个由空格隔开的正整数</span><span style="font-size: 12pt; line-height: 150%">N</span><span style="font-size: 12pt; line-height: 150%">，</span><span style="font-size: 12pt; line-height: 150%">N</span><span style="font-size: 12pt; line-height: 150%">的含义如题目所述。</span></div>
<div style="line-height: 150%"><span style="font-size: 12pt; line-height: 150%">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 12pt; line-height: 150%">接下来有</span><span style="font-size: 12pt; line-height: 150%">N-2</span><span style="font-size: 12pt; line-height: 150%">行，每行包含三个整数</span><span style="font-size: 12pt; line-height: 150%"> p,q,r</span><span style="font-size: 12pt; line-height: 150%">，表示该城市三角形的三个顶点的编号</span><span style="font-size: 12pt; line-height: 150%">(T</span><span style="font-size: 12pt; line-height: 150%">国的</span><span style="font-size: 12pt; line-height: 150%">N</span><span style="font-size: 12pt; line-height: 150%">个顶点按顺时间方向从</span><span style="font-size: 12pt; line-height: 150%">1</span><span style="font-size: 12pt; line-height: 150%">至</span><span style="font-size: 12pt; line-height: 150%">n</span><span style="font-size: 12pt; line-height: 150%">编号</span><span style="font-size: 12pt; line-height: 150%">)</span><span style="font-size: 12pt; line-height: 150%">。</span></div></p><hr/><h3>输出格式</h3><p><div style="line-height: 150%"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 12pt; line-height: 150%">输出文件共包含</span><span style="font-size: 12pt; line-height: 150%">1</span><span style="font-size: 12pt; line-height: 150%">行，表示最多经过的城市数目。</span><span style="font-size: 12pt; line-height: 150%">(</span><u><span style="font-size: 12pt; line-height: 150%">一个城市被当做经过当且仅当其与线路有至少两个公共点</span></u><span style="font-size: 12pt; line-height: 150%">)</span></div></p><hr/><h3>样例输入</h3><pre>      6
     1 2 4
     2 3 4
     1 4 5
     1 5 6
</pre><hr/><h3>样例输出</h3><pre>4</pre><hr/><h3>提示</h3><p><p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 24pt; line-height: 150%"><span lang="EN-US" style="font-size: 12pt; line-height: 150%; mso-bidi-font-size: 11.0pt"><font face="Calibri">4&lt;=N&lt;=200000<o:p></o:p></font></span></p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2657" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2657" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>